package com.yjd.pub.system.service;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.system.model.MobileDataModel;
import com.yjd.comm.system.service.IMobileDataService;
import com.yjd.pub.system.dao.IMobileDataDao;

/**
 * <b>description</b>：登陆记录业务实现<br>
 * <b>time</b>：2014-11-18 11:16:51 <br>
 * <b>author</b>：  ready likun_557@163.com
 */
@Service("mobileDataService")
public class MobileDataServiceImpl extends BaseServiceImpl implements IMobileDataService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public MobileDataModel insert(MobileDataModel model) throws Exception {
		return this.mobileDataDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(MobileDataModel model) throws Exception {
		return this.mobileDataDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param mobile
	 * @return
	 * @throws Exception
	 */
	public int delete(Long mobile) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("mobile", mobile);
		return this.mobileDataDao.deleteModel(paramMap, true);
	}

	@Resource
	private IMobileDataDao mobileDataDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.mobileDataDao;
	}

}
